﻿<!DOCTYPE html>
<!--承包商入场工具管理编辑-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="140px"
            size="mini">
            <el-row>
                <el-col :span="11">
                    <p class="main-label">{{ContractorAdmissionTool.CarryingToolName+mark.m}}</p>
                    <p class="lh35">{{Form.carryingToolName}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">{{ContractorAdmissionTool.ArrivalTime+mark.m}}</p>
                    <p class="lh35" v-if="Form.arrivalTime==null">{{Form.arrivalTime}}</p>
                    <p class="lh35" v-if="Form.arrivalTime!=null">{{Form.arrivalTime.substring(0,16)}}</p>
                </el-col>
                <el-col :span="11">
                    <p class="main-label">{{ContractorAdmissionTool.CarryingToolQuantity+mark.m}}</p>
                    <p class="lh35">{{Form.carryingToolQuantity}}</p>
                </el-col>
            </el-row>

            <el-row style="border:1px  solid;  ">
                <el-col span="24" style="padding-left:30px; ">
                    <el-table :data="Form.cbS_OutFactoryTool" border style="width: 90%">
                        <el-table-column prop="departureTime" :label="ContractorAdmissionTool.DepartureTime" :formatter="dateFormat">
                        </el-table-column>
                        <el-table-column prop="outCarryingQuantity"
                            :label="ContractorAdmissionTool.OutCarryingQuantity">
                        </el-table-column>
                        <el-table-column prop="situationStatement" :label="ContractorAdmissionTool.SituationStatement">
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onBack">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog title="销核历史纪录" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%"
            top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">

        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                title: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    CarryingToolName: '',//携带工具名称
                    CarryingToolQuantity: '',//入场携带工具数量
                    ArrivalTime: '',
                    PinCoreList: [],

                },
                IsConsumables: [],
                ListItem: ListItem,
                //表单验证
                rules: {
                    PersonnelName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 5), message: verification.StringLengthAtoB.m.format(2, 5), trigger: 'blur' }
                    ],
                    ContractorName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],

                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleChange: function (value) {
                    console.log(value);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/CBS_IntoFactoryTool/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getData(this, '/api/CBS_IntoFactoryTool/get?id=' + this.id);
                },

                onBack: function () {
                    parent.app.ListItem.dialogVisible = false;
                }
            },
            mounted: function () {
                //this.IsConsumables = getDicData('50');
                this.id = getUrlParam("id");
                this.getData();
            }
        });
        function dateFormat(row, column, cellValue, index) {
            const daterc = row[column.property]
            return daterc.toString().substring(0, 16);
            //if (daterc != null) {
            //    const date = new Date(parseInt(daterc.replace("/Date(", "").replace(")/", ""), 10));

            //    let Y = date.getFullYear() + '-';
            //    let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) + '-' : date.getMonth() + 1 + '-';
            //    let D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
            //    let h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
            //    let m = date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
            //    let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();

            //    return Y + M + D+h+m;
            //}

        }
    </script>
</body>

</html>